﻿using System.Runtime.Serialization;
using Newtonsoft.Json;

namespace Spikes.ActivityStreams
{
    /// <summary>
    /// An Activity is a description of some activity that occurs in the context of an application.
    /// 
    /// In its simplest form, an activity consists of an actor, a verb, an an object, and a target. It tells the story of a person performing an action on or with an object -- "Geraldine posted a photo to her album" or "John shared a video". In most cases these components will be explicit, but they may also be implied.
    /// </summary>
    [JsonObject()]
    [DataContract]
    public partial class Activity
    {
        /// <summary>
        /// Describes the entity that performed the activity.
        /// </summary>
        [JsonProperty(PropertyName = "actor")]
        [DataMember(Name = "actor")]
        public Object Actor;

        /// <summary>
        /// Natural-language description of the activity encoded as a single JSON String (containing HTML markup).
        /// </summary>
        [JsonProperty(PropertyName = "content")]
        [DataMember(Name = "content")]
        public string Content;

        /// <summary>
        /// Describes the application that generated the activity.
        /// </summary>
        [JsonProperty(PropertyName = "generator")]
        [DataMember(Name = "generator")]
        public Object Generator;

        /// <summary>
        /// Description of a resource providing a visual representation of the object, intended for human consumption.
        /// </summary>
        [JsonProperty(PropertyName = "icon")]
        [DataMember(Name = "icon")]
        public MediaLink Icon;

        /// <summary>
        /// Provides a permanent, universally unique identifier for the activity in the form of a string.
        /// </summary>
        [JsonProperty(PropertyName = "id")]
        [DataMember(Name = "id")]
        public string ID;

        /// <summary>
        /// Describes the primary object of the activity.
        /// </summary>
        [JsonProperty(PropertyName = "object")]
        [DataMember(Name = "object")]
        public Object Object;

        /// <summary>
        /// The date and time (in the Coordinated Universal Time (UTC) format) at which the activity was published.
        /// </summary>
        [JsonProperty(PropertyName = "published")]
        [DataMember(Name = "published")]
        public string Published;

        /// <summary>
        /// Describes the application that published the activity.
        /// </summary>
        [JsonProperty(PropertyName = "provider")]
        [DataMember(Name = "provider")]
        public Object Provider;

        /// <summary>
        /// Describes the target of the activity. The precise meaning of the activity's target is dependent on the activity.
        /// </summary>
        [JsonProperty(PropertyName = "target")]
        [DataMember(Name = "target")]
        public Object Target;

        /// <summary>
        /// Natural-language title or headline for the activity encoded as a single JSON String (containing HTML markup).
        /// </summary>
        [JsonProperty(PropertyName = "title")]
        [DataMember(Name = "title")]
        public string Title;

        /// <summary>
        /// The date and time (in the Coordinated Universal Time (UTC) format) at which a previously published activity has been modified.
        /// </summary>
        [JsonProperty(PropertyName = "updated")]
        [DataMember(Name = "updated")]
        public string Updated;

        /// <summary>
        /// An IRI identifying a resource providing an HTML representation of the activity.
        /// </summary>
        [JsonProperty(PropertyName = "url")]
        [DataMember(Name = "url")]
        public string Url;

        /// <summary>
        /// Identifies the action that the activity describes.
        /// </summary>
        [JsonProperty(PropertyName = "verb")]
        [DataMember(Name = "verb")]
        public string Verb;
    }
}
